package com.lz.homedecoration.common.exception;

import com.lz.homedecoration.common.response.ResultRes;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionHandle {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public ResultRes exceptionHandle(Exception e){
        return  ResultRes.fail(e.getMessage());
    }
}
